package com.demo.apparel.controller.web;

import com.demo.apparel.dto.ClothesAdminDTO;
import com.demo.apparel.dto.PageRequestDTO;
import com.demo.apparel.dto.web.ClothesPageQueryDTO;
import com.demo.apparel.entity.Clothes;
import com.demo.apparel.service.web.ClothesAdminService;
import com.demo.apparel.vo.PageVO;
import com.demo.apparel.common.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/web/clothes")
@Tag(name = "衣橱数据接口", description = "衣物信息接口")
public class ClothesAdminController {

    @Autowired
    private ClothesAdminService clothesAdminService;

    @PostMapping("/list")
    @Operation(summary = "分页获取小程序衣服信息")
    public Result<PageVO<ClothesAdminDTO>> getClothesPage(
            @RequestBody ClothesPageQueryDTO dto
    ) {
        PageVO<ClothesAdminDTO> pageVO = clothesAdminService.pageQuery(dto);
        return Result.success(pageVO);
    }

}
